put the short name of me & ": " after bg fld Events
--identify field
put EndingTicksVariable - StartingTicksVariable after bg fld Events
--Log the number of ticks the mouse was in the field
If cd fld Text ≠ FldOneVariable then
--If the field was changed, log the new contents
put " " & cd fld Text & RETURN after bg fld Events
else
put RETURN after bg fld Events
end if
end mouseLeave
-- part 2 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=77 top=236 right=258 bottom=177
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Button A
----- HyperTalk script -----
on mouseEnter
global StartingTicksVariable
put the ticks into StartingTicksVariable
end mouseEnter
on MouseDown
global clickVariable
put " click " after clickVariable
--HyperCard logs rapid clicks are logged as single clicks
end MouseDown
on MouseLeave
global StartingTicksVariable, FldOneVariable, clickVariable
put the ticks into EndingTicksVariable
put the short name of me & ": " after bg fld Events
--Identify the button
put EndingTicksVariable - StartingTicksVariable after bg fld Events
--Log the time the mouse was within the button
if clickVariable is not empty then
put clickVariable & RETURN after bg fld Events
--If the user clicked, log the clicks
put empty into clickVariable
--reset click counter
else
put RETURN after bg fld Events
end if
end mouseLeave
-- part contents for card part 1
----- text -----
This stack monitors many HyperCard events and logs them in the field at right. When this text is changed, the new text is also logged. The normal text selection motion for most people takes the mouse OUTSIDE of this text box. This causes the event to be posted and unselects the text.